package org.wadael.waverobotfrmwrk.advanced;

import org.wadael.waverobotfrmwrk.utils.BlipUtils;

import com.google.wave.api.Blip;
import com.google.wave.api.event.Event;
import com.google.wave.api.impl.EventMessageBundle;



/** 
 * With this class you can can create robots that only respond to the wavelet creator
 * 
 * @author jerome
 *
 */
@SuppressWarnings("serial")
public abstract class CreatorObedientWithWorkersRobot extends WithWorkersRobot {

	@Override
	public boolean isUserAuthorized(Event event, WithWorkersRobot robot) {
		return BlipUtils.isWaveletCreator(event.getWavelet(),event.getModifiedBy() );
	}
	
//	@Override
//	protected String getRobotAvatarUrl() {
//		// TODO Auto-generated method stub
//		return "http://jeromeb.free.fr/wadrobotframework/avatar.jpg"; //super.getRobotAvatarUrl();
//	}
	
	@Override
	protected void reactToUnknownCommand(Command unknownCommand,
			EventMessageBundle bundle, Blip blip, Event event) {
		blip.reply().append( "Unknown command " + unknownCommand.getInstruction() );
	}
	
}
